<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="/public/favicon.ico">
    <title>签到</title>
    <link href="/public/css/bootstrap.min.css" rel="stylesheet">
    <script src="/public/js/jquery.min.js"></script>
    <script src="/public/js/bootstrap.min.js"></script>
    <script src="/public/js/signin.js"></script>
    <style>
        body {
            padding-top: 50px;
            padding-bottom: 20px;
            background-color: #eee;
        }
    </style>
</head>

<body>

<nav class="navbar navbar-default navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <span class="navbar-brand">你好:</span>
            <a class="navbar-brand" href="/" id="name" title="返回到首页">{{name}}</a>
            <span style="display: none" id="sno">{{sno}}</span>
            <span style="display: none" id="signinid">{{signinid}}</span>
            <div class="navbar-form navbar-right">
                {% if !signstate %}
                <button class="btn btn-success" id="signin">签到</button>
                <button class="btn btn-danger disabled">签退</button>
                {% else%}
                <button class="btn btn-success disabled" >签到</button>
                <button class="btn btn-danger" id="signout">签退</button>
                {% endif %}
                <button class="btn btn-danger" id="logout" style="margin-left: 25px">退出登录</button>
            </div>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <div class="navbar-form navbar-right">
                <div class="form-group">
                    <input type="text" placeholder="输入姓名，搜索签到记录" style="width:180px" class="form-control" id="searchname">
                </div>
                <button class="btn btn-success" id="search">搜索</button>
            </div>

        </div>
    </div>
</nav>

<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
    <div class="container" >
        <table class="table table-hover table-striped">
            <thead>
            <tr class="danger">
                <th>姓名</th>
                <th>签到时间</th>
                <th>签退时间</th>
                <th>在线时长</th>
                <th>当天签到次数</th>
            </tr>
            </thead>
            <tbody>
            {% for row in rows%}
            <tr>
                <td>{{ row.name.toString() }}</td>
                <!--nodejs 存入的时间与模板解析的时间不一致-->
                <td>{{ row.signindate.toString()|date('Y-m-d H:m:s', -480) }}</td>
                <td>{{ row.signoutdate.toString()|date('Y-m-d H:m:s', -480)  }}</td>
                <td>{{ row.onlinetime }}</td>
                <td>{{ row.signintimes }}</td>
            </tr>
            {% endfor %}
            </tbody>
        </table>

        <!--分页-->
        <nav aria-label="Page navigation " style="text-align: center">
            <ul class="pagination">
                <li>
                    <a href="#" aria-label="Previous" id="previous">

                    </a>
                </li>
                <span style="display: none;" id="pages">{{pages.length}}</span>
                {% for i in pages%}
                <li><a href="/admin/signin/?page={{loop.index}}">{{ loop.index }}</a></li>
                {% endfor %}

                <li>
                    <a href="#" aria-label="Next" id="next">

                    </a>
                </li>
            </ul>
        </nav>
    </div>
</div>
</body>
</html>
